<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('客户添加')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-customer-add" th:object="${customer}">
			<input type="hidden" name="id" id="id" th:value="*{id}">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">企业名称：</label>
				<div class="col-sm-8">
					<input class="form-control" th:value="*{customerName}" type="text" name="customerName" id="customerName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">法定代表人：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" th:value="*{legalLeader}" name="legalLeader" id="legalLeader" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">成立日期：</label>
				<div class="col-sm-8">
					<input class="form-control myDate" th:value="${#dates.format(customer.registerDate, 'yyyy-MM-dd')}" type="text" name="registerDate" id="registerDate" required>
				</div>

			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">经营状态：</label>
				<div class="col-sm-8">
					<select class="form-control" name="openState" th:field="*{openState}" th:with="type=${@dict.getType('ep_open_status')}">
						<option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">所属地区：</label>
				<div class="col-sm-8">
					<select class="form-control" name="province" th:field="*{province}" th:with="type=${@dict.getType('ep_province_state')}">
						<option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">所属行业：</label>
				<div class="col-sm-8">
					<input class="form-control" th:value="*{industry}" type="text" name="industry" id="industry" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">注册资本：</label>
				<div class="col-sm-8">
					<input class="form-control" th:value="*{regCapital}" type="text" name="regCapital" id="regCapital" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">注册地址：</label>
				<div class="col-sm-8">
					<textarea id="regAddr" th:text="*{regAddr}" name="regAddr" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">经营范围：</label>
				<div class="col-sm-8">
					<textarea id="scope" th:text="*{scope}" name="scope" class="form-control"></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="common/include :: footer" />
	<link rel="stylesheet" type="text/css" href="/plugins/datetimepicker/jquery.datetimepicker.min.css"/>
	<script src="/plugins/datetimepicker/jquery.datetimepicker.full.js"></script>

	<script type="text/javascript">
		var prefix = ctx + "/business/customer";
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-customer-add').serialize());
	        }
	    }
		$('.myDate').datetimepicker({
			format:'Y-m-d'
		});
		$.datetimepicker.setLocale('zh');
	</script>
</body>
</html>
